package day09.Ti.HashMapDome;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Ti01 {
    public static void main(String[] args) {
        HashMap<Integer, String> hm = new HashMap<>();
//        101,阿三面馆
//        102,阿四粥馆
//        103,阿五米馆
//        104,阿六快递
        hm.put(101, "阿三面馆");
        hm.put(102, "阿四面馆");
        hm.put(103, "阿五面馆");
        hm.put(104, "阿六面馆");
        Set<Integer> s = hm.keySet();
        for (Integer key : s) {
            String value = hm.get(key);
            System.out.println(key+"---"+value);

        }
        System.out.println("--------");
        Set<Map.Entry<Integer, String>> entries = hm.entrySet();
        for (Map.Entry<Integer, String> entry : entries) {
            Integer key = entry.getKey();
            String value = entry.getValue();
            System.out.println(key+"---"+value);
        }
        System.out.println("-----");
        hm.forEach((Integer a,String b)->{
            System.out.println(a+"---"+b);
        });
    }
}
